package Lists;

import java.lang.reflect.Array;

public class ArrayList implements IList {

    public void array() {
        System.out.print("Исходный массив: ");
        int[] array = new int[10];
        for (int i = 0; i < 10; i++) {
            array[i] = i;
            System.out.print(" " + array[i]);
        }
        System.out.println(" ");
        int arraySize = Array.getLength(array);
        int lastElement = array.length - 1;
        if (lastElement != 0) {
            int newArraySize = (3 * arraySize / 2);
            int[] newArray = new int[newArraySize];

            System.arraycopy(array, 0, newArray, 0, array.length);
            System.out.print("расширенный массив: ");
            for (int i = 0; i < newArray.length; i++) {
                newArray[i] = i;
                System.out.print(" " + newArray[i]);
            }
            System.out.println(" ");

        }

    }

    public void toString(int start) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

}
